package cn.edu.hunau.basic.day02;

import org.junit.Test;

import java.util.Scanner;

/**
 * @author hb
 * @date 2025-07-29 15:42:34
 */
public class IfTest {

    @Test
    public void testSwitch(){
        int a=1;
        switch(a){
            case 1:
                System.out.println("1");
            case 2:
                System.out.println("2");
            case 3:
                System.out.println("3");
            default: System.out.println("default");

        }
    }

    @Test
    public void testScore(){
        Scanner sc=new Scanner(System.in);
        int score = sc.nextInt();  //alt+enter
        if(score>=90){
            System.out.println("优秀");
        }else if(score>=80 ){
            System.out.println("良好");
        }else if(score>=70 ){
            System.out.println("中等");
        }else if(score>=60 ){
            System.out.println("及格");
        } else{
            System.out.println("不及格");
        }
    }

    @Test
    public void test01(){
        Scanner sc=new Scanner(System.in);
        int num = sc.nextInt();  //alt+enter
        if(num%2==0){
            System.out.println("偶数");
        }else{
            System.out.println("奇数");
        }
    }
}
